package com.tomicalab.mobiletoken.ckca.utils;

import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.res.Resources;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

import com.tomicalab.mobiletoken.ckca.R;

public class Constant {
	public static String Debug = 		"Vudp";
	
	public static final int SHOWPROGRESSDIALOG 		= 0x00000001;
	public static final int CLOSEPROGRESSDIALOG 	= 0x00000002;
	public static final int SHOWERRINFO				= 0x00000003;
	public static final int CHANGEPIN				= 0x00000004;
	public static final int UNBLOCKPIN				= 0x00000005;
	public static final int LOGIN					= 0x00000006;
	public static final int GETCERTIFICATEVIEW		= 0x00000007;
	public static final int RENEW					= 0x00000008;
	public static final int GETCERT					= 0x00000009;
	public static final int INITCONECTION			= 0x00000010;
	public static final int VERIFYPIN				= 0x00000011;
	public static final int IMPORTCERT				= 0x00000012;
	public static final int GETALLCERT				= 0x00000013;
	public static final int GETALLCERTCOMPLETE		= 0x00000014;
	
    public static void showMessage(String msg, Context context, Resources res)
	{
    	if (null == msg || "" == msg)
    		return;
    	
    	String title, button;
    		button = res.getString(R.string.inform_button_OK);
			title = res.getString(R.string.inform_title);
		new Builder(context)
    	.setTitle(title)
    	.setMessage(msg)
    	.setPositiveButton(button, null).show();
	}
    
	public static void hideSoftKeyboard (Activity activity, View view) 
	{
	    InputMethodManager imm = (InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE);
	    imm.hideSoftInputFromWindow(view.getApplicationWindowToken(), 0);
	}
}
